package com.cs.study.homework._0206;

import java.util.Arrays;

public class Demo {
    public static void main(String[] args) {
        String[] arr = new String[10];
        System.out.println("方式一：" + Arrays.toString(arr));
        System.out.println(getArray1(arr));
        System.out.println(getArray2(arr));
        System.out.println("数组长度是" + arr.length);

    }


    public static String getArray1(String[] arr) {
        System.out.print("方式二：");
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + "  ");
        }
        return " ";
    }

    public static String getArray2(String[] arr) {
        System.out.print("方式三：");
        for (String arr1: arr) {
            System.out.print(arr1 + "  ");
        }
        return " ";
    }
}
